export const getTime = (time: string | undefined): string => {
  let dateTime;
  const timer = time ? new Date(+time) : new Date();
  let yy: number = timer.getFullYear();
  let mm: number = timer.getMonth() + 1;
  let dd: number = timer.getDate();
  let hh: number = timer.getHours();
  let mf: string | number =
    timer.getMinutes() < 10 ? '0' + timer.getMinutes() : timer.getMinutes();
  let ss =
    timer.getSeconds() < 10 ? '0' + timer.getSeconds() : timer.getSeconds();
  dateTime = yy + '-' + mm + '-' + dd + ' ' + hh + ':' + mf + ':' + ss;
  return dateTime;
};
